<{include file="public/header.html"}>
		<div class="xinsu-right">
			<div class="xinsu-right-title" id="xinsu-zhishu"></div>
			<div class="xinsu-right-content">	
				<form class="layui-form xinsu-form" action="" method="get">
					<div class="layui-form-item">
						<div class="layui-inline">
						    <label class="layui-form-label xinsu-form-label">查询日期</label>
						    <div class="layui-input-inline">
						        <input type="text" name="start_time" id="start_time" autocomplete="off" class="layui-input" onclick="layui.laydate({elem: this,max:laydate.now()})" value="<{if 0 != $start_time}><{$start_time}><{/if}>">
						    </div>
						    <label class="layui-form-label xinsu-form-label2">至</label>
						    <div class="layui-input-inline">
						       <input type="text" name="end_time" id="end_time" autocomplete="off" class="layui-input" onclick="layui.laydate({elem: this,max:laydate.now()})" value="<{if 0 != $end_time}><{$end_time}><{/if}>">
						    </div>
						</div>
						<button class="layui-btn xinsu-btn" >查询</button>
					</div>
				</form>
				<div class="layui-form">
					<table class="layui-table" lay-skin="line">
						<thead>
							<tr>
								<th>编号</th>
								<th>发送用户</th>
								<th>标题</th>
								<th>时间</th>
								<th>状态</th>
							</tr> 
						</thead>
						<tbody>
							<{if empty($list) == false}>
							<{foreach $list as $val}>
							<tr>
								<td><{$val.id}></td>
								<td>管理员</td>
								<td><a href="javascript:;" class="xinsu-fontcolor-green xinsu-read-message" data="<{$val.id}>" data-content="<{$val.content}>" data-read="<{$val.isread}>"><{$val.title}></a></td>
								<td><{$val["addtime"]}></td>	
								<td><{if $val.isread == 0}>未读<{else}>已读<{/if}></td>
							</tr>
							<{/foreach}>
							<{else}>
							<tr>
								<td colspan="5">暂无数据</td>
							</tr>
							<{/if}>
						</tbody>
					</table>
				</div>
				<div class="xinsu-page">
					<div class="xinsu-show">
						<{$page}>
					</div>
					<div class="xinsu-clear"></div>
				</div>
			</div>
		</div>
		<script>
			//用户信息弹出框
			$('.xinsu-read-message').click(function(){
				var id = $(this).attr("data");
				var content = $(this).attr("data-content");
				var read = $(this).attr("data-read");
				var title = $(this).html();
				var sender = $(this).parents("tr").find('td').eq(1).html();
				var add_time = $(this).parents("tr").find('td').eq(3).html();
				var obj = $(this);
				layer.open({ 
					type: 1,
					title: '阅读短信',
					area: ['550px', '320px'],
					shadeClose: true, //点击遮罩关闭
					content: '<div style="padding:20px 40px; line-height:36px; font-size:14px;"><p>发送用户：'+sender+'</p><p>短信标题：<span class="xinsu-fontcolor-grey">'+title+'</span></p><form><table><tbody><tr class="xinsu-row-ls"><td align="right" style="vertical-align: text-top;">短信内容：</td><td><span class="layui-textarea" style="width:400px;">'+content+'</span></td></tr></tbody></table><p>发送时间：<span class="xinsu-fontcolor-grey">'+add_time+'</span></p></form></div>',
					cancel:function(){
						if (read == 0) {
							http_request_post("/user/read_message", {id : id}, function (result) {
								obj.parents("tr").find('td').eq(4).html("已读");
							})
						}
					}
				});	
			});
		</script>
<{include file="public/footer.html"}>